<?php
include_once "../../pdo_boot.php";

class <cs_name>_mdl {

static function do_update($keyvalues, $newvalues, $maintable){

	$result = CF_CrudLibPdo::CrudSave($keyvalues, $newvalues, $maintable);
	return $result;

}

static function do_delete($keyvalues,$maintable){
	$result = CF_CrudLibPdo::CrudDelete($keyvalues,$maintable);
	return $result;
}

static function do_add($keyvalues, $newvalues, $maintable){

	$result = CF_CrudLibPdo::CrudAdd($keyvalues, $newvalues, $maintable);
	return $result;
}


static function get_records($filter, $order = null, $limit = null){
	$basequery = "SELECT * FROM <main_table> WHERE 1 ";
	$ar_data = get_array_query_full("SELECT * FROM <main_table> WHERE 1 ", $filter, $order);
	return $ar_data;
	
}




static function get_lookuplists($fs,$ar_columns,$set){

	//$table_id = lookup_value('main_table','crudsets'," crudset_id = " . $set['crudset_id']);
	//$set['source_id'] = $table_id;

	$lr = new CF_LookupResolver;
	$fs->SetupLookupResolver($lr);
	
	$ar_lookups = $lr->GetLists($ar_columns, $set);
	return $ar_lookups;

}
}
?>